package com.pair.micro.common.exception;

import com.pair.micro.common.constant.MicroSystemError;
import lombok.Getter;

/**
 * 系统异常
 * @author xubz
 */
public class MicroSystemException extends RuntimeException {

    @Getter
    private MicroSystemError microSystemError;

    public MicroSystemException() {
        super(MicroSystemError.SYS_00002.getMsg());
    }

    public MicroSystemException(MicroSystemError microSystemError) {
        super(microSystemError.getMsg());
        this.microSystemError = microSystemError;
    }

    public MicroSystemException(MicroSystemError microSystemError, String exception) {
        super(exception);
        this.microSystemError = microSystemError;
    }

    public MicroSystemException(MicroSystemError microSystemError, Throwable e) {
        super(microSystemError.getMsg(), e);
        this.microSystemError = microSystemError;
    }
}
